package com.chinacoal.hr.levelapi.api;

import com.baomidou.mybatisplus.plugins.Page;
import com.chinacoal.hr.levelapi.api.fallback.WorkflowClientFallback;
import com.chinacoal.hr.levelapi.entity.*;
import com.chinacoal.hr.levelapi.util.Result;
import org.springframework.cloud.openfeign.FeignAutoConfiguration;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.List;

@FeignClient(name = "CCMS-WORKFLOW", configuration = {FeignAutoConfiguration.class}, fallback = WorkflowClientFallback.class)
public interface WorkflowClient {

    @RequestMapping(value = "/workflow/processSubmit", method = RequestMethod.POST)
    public Result<InstanceEntity> processSubmit(@Valid @RequestBody SubmitParam paramSubmitParam);

    //
    @RequestMapping(value = "/workflow/completeTask", method = RequestMethod.POST)
    public Result<InstanceEntity> completeTask(@Valid @RequestBody ApproveParam paramApproveParam);

    //
//    @RequestMapping(value = "/workflow/processSubmit", method = RequestMethod.POST)
//    public Result<Object> deleteInstanceById(@RequestBody List<Long> paramList);
//
//    @RequestMapping(value = "/workflow/processSubmit", method = RequestMethod.POST)
//    public Result<Page<WorkItemEntity>> getTaskList(@PathVariable("page") Integer paramInteger1, @PathVariable("pageSize") Integer paramInteger2, @Valid @RequestBody QueryTaskListParam paramQueryTaskListParam);
//
//    @RequestMapping(value = "/workflow/processSubmit", method = RequestMethod.POST)
//    public Result<Page<WorkItemEntity>> getAchTaskList(@PathVariable("page") Integer paramInteger1, @PathVariable("pageSize") Integer paramInteger2, @Valid @RequestBody QueryTaskListParam paramQueryTaskListParam);
//
    @RequestMapping(value = "/workflow/approvalHistory/{instanceId}/{page}/{pageSize}", method = RequestMethod.GET)
    public Result<Page<ApprovalHistoryEntity>> getApprovalHistory(@PathVariable("page") Integer paramInteger1, @PathVariable("pageSize") Integer paramInteger2, @PathVariable("instanceId") Long paramLong);
}